package com.yanqu.road.server.cmd.activity.biaoju.cross;

import com.yanqu.road.entity.activity.biaoju.UserBiaoJuData;
import com.yanqu.road.entity.enums.eMessageType;
import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.logic.activity.biaoju.BiaoJuConfig;
import com.yanqu.road.logic.helper.UnionActivityGroupHelper;
import com.yanqu.road.logic.pb.PlayerBasePb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.BiaoJuProto;
import com.yanqu.road.pb.worldmessage.WorldMessageProto;
import com.yanqu.road.server.GameServer;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.biaoju.ActivityBiaoJuModule;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.biaoju.BiaoJuConfigMgr;
import com.yanqu.road.server.manger.player.UserMgr;
import com.yanqu.road.server.manger.player.WorldMessageMgr;
import com.yanqu.road.server.manger.union.GameUnionActivityGroupMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.date.DateHelper;

@Cmd(code = Protocol.S_BIAOJU_TAKE_ESCORT_CROSS_BACK, desc = "接镖跨服返回")
public class BiaoJuTakeEscortCrossBackCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        BiaoJuProto.BiaoJuTakeEscortRespMsg respMsg = BiaoJuProto.BiaoJuTakeEscortRespMsg.parseFrom(packet.getBytes());

        player.sendPacket(ClientProtocol.U_BIAOJU_TAKE_ESCORT, respMsg.toBuilder());

        if (respMsg.getRet() == 0) {
            player.getModule(ActivityBiaoJuModule.class).takeEscortBack(respMsg);
        }
    }

    @Override
    public void sendData(GamePlayer player) {
    }

}
